<template>
	<!--步骤信息和图片-->
	<el-form ref="form" v-model="stepform" label-width="80px">
		<el-form-item :inline="true" label="步骤:">
			<!-- 渲染问题列表 -->
			<section v-for="(value, index) in stepform.stitle" :key="index">
				<section v-if="index === 0">
					<el-row>
						<el-col :span="6">
							<el-input :disabled="edits" v-model="stepform.stitle[index]" placeholder="步骤名称:" clearable @keyup.enter.native="addstep(index, '1')" />
							<br />
							<el-input :disabled="edits" v-model="stepform.sdesc[index]" type="textarea" :rows="5" placeholder="步骤描述:"
							 clearable @keyup.enter.native="addstep(index, '1')" />
						</el-col>
						<el-col @click.native="getIndex(index)" class="msnum" :span="40">
							<el-upload :disabled="edits" clearable @keyup.enter.native="addstep(index, '1')" :auto-upload="false" :on-change="onchange"
							 :on-remove="handleRemove" :limit="1" list-type="picture-card" action="#">
								<i class="el-icon-plus"></i>
							</el-upload>
							<!--图片展示-->
							<el-dialog>
								<img width="100%" :src="src" alt="">
							</el-dialog>

						</el-col>
						<el-col :span="4">
							<el-button :disabled="edits" type="primary" icon="el-icon-plus" plain style="margin-left:10px;" circle @click="addstep(index, '1')" />
						</el-col>
					</el-row>
				</section>
				<section v-if="index>0">
					<!-- 添加的子项目 -->
					<el-row style="margin-top:10px;">
						<el-col :span="6">
							<el-input :disabled="edits" v-model="stepform.stitle[index]" placeholder="步骤名称:" clearable @keyup.enter.native="addstep(index, '1')" />
							<br />
							<el-input :disabled="edits" v-model="stepform.sdesc[index]" type="textarea" :rows="5" placeholder="步骤描述:"
							 clearable @keyup.enter.native="addstep(index, '1')" />
						</el-col>
						<el-col @click.native="getIndex(index)" class="msnum" :span="40">
							<!-- <el-input :disabled="edits" v-model="stepform.sdesc[index]" placeholder="请输入步骤单位" clearable @keyup.enter.native="addstep(index, '1')" /> -->
							<el-upload :disabled="edits" clearable @keyup.enter.native="addstep(index, '1')" :auto-upload="false" :on-change="onchange"
							 :on-remove="handleRemove" :limit="1" list-type="picture-card" action="#">
								<i class="el-icon-plus"></i>
							</el-upload>
							<!--图片展示-->
							<el-dialog>
								<img width="100%" :src="src" alt="">
							</el-dialog>

						</el-col>
						<el-col :span="4">
							<el-button :disabled="edits" type="danger" icon="el-icon-delete" plain style="margin-left:10px;" circle @click="removems(index, '1')" />
						</el-col>
					</el-row>
				</section>
			</section>
		</el-form-item>
		<el-form-item>
			<el-button type="success" @click="subStep">确认</el-button>
			<el-button type="primary" @click="editStep">编辑</el-button>
		</el-form-item>
	</el-form>
</template>

<script src="../../js/MenuAdd/stepNode.js"></script>

<style>
</style>
